﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DIProject.Setting
{
    public partial class CashPassword : Form
    {
        public CashPassword()
        {
            InitializeComponent();
        }

        private void CashPassword_Load(object sender, EventArgs e)
        {
            DataSets.SettingsTableAdapters.DepartmentsTableAdapter adapt = new DIProject.DataSets.SettingsTableAdapters.DepartmentsTableAdapter();
            DataSets.Settings.DepartmentsDataTable dept = adapt.GetData();
            cbDepartments.DataSource = dept;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Int32 deptId = (Int32)cbDepartments.SelectedValue;
            string str = txbPassword.Text;
            DIProject.Util.Setting.SetCashPassword(deptId, str);
        }
    }
}